import socket  
import time


    
if __name__ == '__main__':
    print 'start'  
    address = ('', 502)  
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.bind(address)
    s.listen(5)  
    
    while 1:
    
        ss, addr = s.accept()  
        print 'got connected from',addr  
        
        
        time.sleep(1) 
        ss.close()  
        
    s.close()
    
    print 'end'